<?php $this->_extends('_layouts/cib_layout'); ?>

<?php $this->_block('metainfo'); ?>
    <title></title>
    <meta name="Description" content="上海外国语大学国际工商管理学院,SISUCIB" />
    <meta name="Keywords"    content="上海外国语大学国际工商管理学院,SISUCIB" />
    <link rel="stylesheet" type="text/css" href="profiles/<?=Q::ini('appini/skin');?>/cib-search.css" />
    <style type="text/css" media="all"><?=$css;?></style>
<?php $this->_endblock('metainfo'); ?>

<?php $this->_block('container'); ?>
<div id="container">

    <div id="ssb">
        <p>约有 <b><?=$counter;?></b> 项符合 <b><?=$_GET['q'];?></b> 的查询结果，以下是第 <b>1-10</b> 项 （搜索用时 <b><?=$query_time;?></b> 秒）</b></p>
    </div>

    <?php $this->_element('g-pieces/search/g-pieces-search-resultNavigator');?>

    <div id="resultPanel">

    <?php if($newsSys['counter'] > 0 && $searchIn['newsSys'] == 'on') { ?>
        <div id="subsysNews">
            <p><b>新闻管理系统 以下是 第 1-3 项</b>，<a href="#">更多</a></p>
            <ul>

                <?php foreach($newsByContent as $n) { ?>
                <li>
                    <p class="subsysNewsTitle">
                        <a href="<?=url('newsnotice/index', array('news_id'=>$n->news_id, 'title'=>mb_substr(strip_tags($n->title), 0, Q::ini('appini/ahref_title'), 'utf-8')));?>"><?=$n->title;?></a>
                        <?php if(!$n->attachments->isEmpty()) { ?>
                        <img src="misc/with-attachment.gif" alt="attachmentMark" />
                        <?php } ?>
                    </p>
                    <p class="subsysNewsPreinfo">
                        <?php if($n->sticky == 1) { ?>
                        <span class="highlight"><b>置顶新闻</b></span>
                        <?php } ?>

                        <span>阅读: <?=$n->hasread;?> 次 </span>

                        <?php if($n->attachments->count() > 0) { ?>
                        <span>附件：<?=$n->attachments->count();?>个</span>
                        <?php } ?>

                        <?php if($n->tag != '') { ?>
                        <span>标签：<?=trim($n->tag, ',');?></span>
                        <?php } ?>

                        <span>发布日期：<?=$n->adate;?></span>
                        <!--<span>版块：<a href="#">新闻与通知</a></span>-->
                    </p>
                    <p class="subsysNewsBody"><?=$n->body;?></p>
                    <p class="subsysNewsUrl">http://cib.shisu.edu.cn<?=url('newsnotice/index', array('news_id'=>$n->news_id, 'title'=>mb_substr(strip_tags($n->title), 0, Q::ini('appini/ahref_title'), 'utf-8')));?></p>
                </li>
                <?php } ?>
            </ul>
        </div>
    <?php } ?>

    <?php if($teacherSys['counter'] > 0 && $searchIn['teacherSys'] == 'on') { ?>
        <div id="subsysTeacher">
            <p><b>教师管理系统 以下是 第 1 项</b>，<a href="#">更多</a></p>
            <ul>
                <?php foreach($teacherByName as $teacher) { ?>
                <li>
                    <div class="tprofile">
                        <a href="<?=url('faculty/facultydetail', array('teacher_id'=>$teacher->teacher_id, 'teacher_name'=>strip_tags($teacher->name)));?>">
                            <img src="<?=$teacher->profile_path;?>"/>
                        </a>
                        <span style="display:block;text-align:center;">
                            <a href="#"><?=$teacher->name;?></a>
                        </span>
                        <span style="display:block;text-align:center;">&nbsp;</span>
                        <span style="display:block;text-align:center;">
                            <?php foreach($teacher->titles as $title) {
                            echo $title->title.' ';
                            } ?>
                        </span>
                        <span style="display:block;text-align:center;"><?=$teacher->major->major;?></span>
                    </div>
                    <div class="tdescription">
                        <p><?=$teacher->description;?></p>
                    </div>
                    <p class="subsysTeacherUrl">http://cib.shisu.edu.cn<?=url('faculty/facultydetail', array('teacher_id'=>$teacher->teacher_id, 'teacher_name'=>$teacher->name));?></p>
                </li>
                <?php } ?>
            </ul>
        </div>
    <?php } ?>

    <?php if($fileSys['counter'] > 0 && $searchIn['fileSys'] == 'on') { ?>
        <div id="subsysFile">
            <p><b>文件管理系统 以下是 第 1-3 项</b>，<a href="#">更多</a></p>
            <ul>
                <?php foreach($fileByFilename as $file) { ?>
                <li>
                    <p class="subsysFileFilename">
                        <a href="<?=url('utility/download', array('file_id'=>$file->file_id, 'mode'=>'file', 'filename'=>mb_substr(strip_tags($file->filename), 0, Q::ini('appini/ahref_title'), 'utf-8')));?>"><?=$file->filename;?></a>
                    </p>
                    <p class="subsysFilePreinfo">
                        <span>上传日期：<?=date('Y-m-d', $file->created);?></span>
                    </p>
                    <p class="subsysFileDescription"><?=$file->description;?></p>
                    <p class="subsysFileUrl">http://cib.shisu.edu.cn<?=url('utility/download', array('file_id'=>$file->file_id, 'mode'=>'file', 'filename'=>mb_substr(strip_tags($file->filename), 0, Q::ini('appini/ahref_title'), 'utf-8')));?><p>
                </li>
                <?php } ?>
            </ul>
        </div>
    <?php } ?>

    <?php if($counter == 0) { ?>
        <center>
            <p>很抱歉，没有关于 <b><?=$_GET['q'];?></b> 的搜索结果</p>
            <p> 我们推荐您搜索:
                <a href="<?=url('search/index', array('q'=>'公共关系'));?>">公共关系</a>，热门搜索:
                <a href="<?=url('search/index', array('q'=>'国际交流'));?>" class="highlight">国际交流</a></p>
        </center>
    <?php } ?>
    </div><!-- /resultPanel -->

    <div id="resultAddition">
        &nbsp;
    </div><!-- /resultAddition -->

</div><!-- /container-->
<?php $this->_endblock('container'); ?>